package cc.lishixi.book.dao.mapper;

import cc.lishixi.book.entity.LendInfo;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by LiShixi on 2016/7/24 0024.
 * http://www.lishixi.cc
 */
    /* int id;
        String readerId;
        String bookcode;
        String borrowdate;
        String duedate;
        String returndate;
        int renew;
        int overduedays;
        float fine;*/
public class LendInfoRowMapper implements RowMapper<LendInfo> {
    @Override
    public LendInfo mapRow(ResultSet r, int i) throws SQLException {
        LendInfo l = new LendInfo();

        l.setId(r.getInt("id"));
        l.setReaderId(r.getString("readerId"));
        l.setBookcode(r.getString("bookcode"));
        l.setBorrowdate(r.getString("borrowdate"));
        l.setDuedate(r.getString("duedate"));
        l.setReturndate(r.getString("returndate"));
        l.setRenew(r.getInt("renew"));
        l.setOverduedays(r.getInt("overduedays"));
        l.setFine(r.getFloat("fine"));
        return l;
    }

}
